package com.pxx.item.api;

import com.item.common.PageResult;
import com.pxx.item.pojo.Sku;
import com.pxx.item.pojo.TbSpuDetail;
import com.pxx.item.pojo.vo.SpuVo;
import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface GoodsApi {

    @GetMapping("/spu/page")
    public PageResult<SpuVo> querySpuVoPage(
            @RequestParam(value = "key",required = false) String key,
            @RequestParam(value = "saleable",required = false)   Boolean saleable,
            @RequestParam(value = "page",defaultValue = "1")    Integer page,
            @RequestParam(value = "rows",defaultValue = "5")     Integer rows
    );

    @GetMapping("/spu/detail/{spuId}")
    TbSpuDetail querySpuDetailBySpuId(@PathVariable("spuId")Long spuId);


    /**
     * 通过spuId查询skus的列表数据
     */
    @GetMapping("/sku/list")
    List<Sku> querySkuListBySpuId(@RequestParam("id")Long id);

}
